@extends('layouts.app')
@section('content')
    <heading>拉取请求</heading>

    @foreach($repository->pulls as $chapter)
        <tig-chapter-item :chapter="{{json_encode($chapter)}}">

            @can('repositories.pull',$repository)
                <tig-form
                        action="{{route('repositories.pulls.merge',['repository'=>$repository])}}">
                    <input type="hidden" name="sequence" value="{{$chapter->pivot->sequence}}">
                    <input type="hidden" name="chapter_id" value="{{$chapter->id}}">
                    <button class="btn btn-white p-2 block"
                            type="submit">将该版本合并到本作品中
                    </button>
                </tig-form>

            @endcan

        </tig-chapter-item>
    @endforeach


@endsection